//
//  MapViewManager.h
//  PigMarket
//
//  Created by mac on 2019/5/20.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void (^SearchResultBlock)(NSMutableArray *searchResultArr);
typedef void (^CurrentAddressBlock)(NSString *currentAddress, NSString *currentDetailAddress);
typedef void (^UserSearchAddressBlock)(NSMutableArray *addressArr);
typedef void (^LocationFailureBlock)(BOOL isFailure);
@interface MapViewManager : UIView

/**
 搜索结果
 */
@property (nonatomic , copy) SearchResultBlock searchResultBlock;
/**
 当前位置
 */
@property (nonatomic , copy) CurrentAddressBlock currentAddressBlock;
/**
 用户手动输入搜索地址
 */
@property (nonatomic , copy) UserSearchAddressBlock userSearchAddressBlock;
/**
 定位是否成功
 */
@property (nonatomic , copy) LocationFailureBlock locationFailureBlock;

+ (instancetype)sharedManager;

/**
 加载地图

 @param dataArr 经纬度坐标arr
 */
- (void)configMapWithDataArr:(NSMutableArray *)dataArr
                failureBlock:(void (^)(BOOL isFailure))faileureBlock;

/**
 用户搜索地址

 @param address 用户输入的地址
 @param completeBlock 成功回调 地址arr
 */
- (void)userSearchAddressWithInputAddress:(NSString *)address
                            completeBlock:(void(^)(NSMutableArray *addressArr))completeBlock;
@end

